\(\int \tan ^2(x) (a+a \tan ^2(x))^{3/2} \, dx\) [267]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 17, antiderivative size = 59 \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=-\frac {1}{8} a \text {arctanh}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {1}{8} a \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} a \sec ^2(x) \sqrt {a \sec ^2(x)} \tan (x) \]

[Out]

-1/8*a*arctanh(sin(x))*cos(x)*(a*sec(x)^2)^(1/2)-1/8*a*(a*sec(x)^2)^(1/2)*tan(x)+1/4*a*sec(x)^2*(a*sec(x)^2)^(
1/2)*tan(x)

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3738, 4210, 2691, 3853, 3855} \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=-\frac {1}{8} a \cos (x) \sqrt {a \sec ^2(x)} \text {arctanh}(\sin (x))+\frac {1}{4} a \tan (x) \sec ^2(x) \sqrt {a \sec ^2(x)}-\frac {1}{8} a \tan (x) \sqrt {a \sec ^2(x)} \]

[In]

Int[Tan[x]^2*(a + a*Tan[x]^2)^(3/2),x]

[Out]

-1/8*(a*ArcTanh[Sin[x]]*Cos[x]*Sqrt[a*Sec[x]^2]) - (a*Sqrt[a*Sec[x]^2]*Tan[x])/8 + (a*Sec[x]^2*Sqrt[a*Sec[x]^2
]*Tan[x])/4

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4210

Int[(u_.)*((b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sec[e + f*x]^n)^FracPart[p]/(Sec[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sec[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \int \left (a \sec ^2(x)\right )^{3/2} \tan ^2(x) \, dx \\ & = \left (a \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec ^3(x) \tan ^2(x) \, dx \\ & = \frac {1}{4} a \sec ^2(x) \sqrt {a \sec ^2(x)} \tan (x)-\frac {1}{4} \left (a \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec ^3(x) \, dx \\ & = -\frac {1}{8} a \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} a \sec ^2(x) \sqrt {a \sec ^2(x)} \tan (x)-\frac {1}{8} \left (a \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \, dx \\ & = -\frac {1}{8} a \text {arctanh}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {1}{8} a \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} a \sec ^2(x) \sqrt {a \sec ^2(x)} \tan (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.58 \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\frac {1}{8} \left (a \sec ^2(x)\right )^{3/2} \left (-\text {arctanh}(\sin (x)) \cos ^3(x)-\cos (x) \sin (x)+2 \tan (x)\right ) \]

[In]

Integrate[Tan[x]^2*(a + a*Tan[x]^2)^(3/2),x]

[Out]

((a*Sec[x]^2)^(3/2)*(-(ArcTanh[Sin[x]]*Cos[x]^3) - Cos[x]*Sin[x] + 2*Tan[x]))/8

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {\tan \left (x \right ) \left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{4}-\frac {a \tan \left (x \right ) \sqrt {a +a \tan \left (x \right )^{2}}}{8}-\frac {a^{\frac {3}{2}} \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \tan \left (x \right )^{2}}\right )}{8}\) \(54\)
default \(\frac {\tan \left (x \right ) \left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{4}-\frac {a \tan \left (x \right ) \sqrt {a +a \tan \left (x \right )^{2}}}{8}-\frac {a^{\frac {3}{2}} \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \tan \left (x \right )^{2}}\right )}{8}\) \(54\)
risch \(\frac {i a \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left ({\mathrm e}^{6 i x}-7 \,{\mathrm e}^{4 i x}+7 \,{\mathrm e}^{2 i x}-1\right )}{4 \left ({\mathrm e}^{2 i x}+1\right )^{3}}-\frac {a \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )}{4}+\frac {a \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )}{4}\) \(118\)

[In]

int(tan(x)^2*(a+a*tan(x)^2)^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/4*tan(x)*(a+a*tan(x)^2)^(3/2)-1/8*a*tan(x)*(a+a*tan(x)^2)^(1/2)-1/8*a^(3/2)*ln(a^(1/2)*tan(x)+(a+a*tan(x)^2)
^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.97 \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\frac {1}{16} \, a^{\frac {3}{2}} \log \left (2 \, a \tan \left (x\right )^{2} - 2 \, \sqrt {a \tan \left (x\right )^{2} + a} \sqrt {a} \tan \left (x\right ) + a\right ) + \frac {1}{8} \, {\left (2 \, a \tan \left (x\right )^{3} + a \tan \left (x\right )\right )} \sqrt {a \tan \left (x\right )^{2} + a} \]

[In]

integrate(tan(x)^2*(a+a*tan(x)^2)^(3/2),x, algorithm="fricas")

[Out]

1/16*a^(3/2)*log(2*a*tan(x)^2 - 2*sqrt(a*tan(x)^2 + a)*sqrt(a)*tan(x) + a) + 1/8*(2*a*tan(x)^3 + a*tan(x))*sqr
t(a*tan(x)^2 + a)

Sympy [F]

\[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\int \left (a \left (\tan ^{2}{\left (x \right )} + 1\right )\right )^{\frac {3}{2}} \tan ^{2}{\left (x \right )}\, dx \]

[In]

integrate(tan(x)**2*(a+a*tan(x)**2)**(3/2),x)

[Out]

Integral((a*(tan(x)**2 + 1))**(3/2)*tan(x)**2, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 934 vs. \(2 (47) = 94\).

Time = 0.52 (sec) , antiderivative size = 934, normalized size of antiderivative = 15.83 \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\text {Too large to display} \]

[In]

integrate(tan(x)^2*(a+a*tan(x)^2)^(3/2),x, algorithm="maxima")

[Out]

1/16*(112*a*cos(3*x)*sin(2*x) - 16*a*cos(x)*sin(2*x) + 16*a*cos(2*x)*sin(x) - 4*(a*sin(7*x) - 7*a*sin(5*x) + 7
*a*sin(3*x) - a*sin(x))*cos(8*x) + 8*(2*a*sin(6*x) + 3*a*sin(4*x) + 2*a*sin(2*x))*cos(7*x) + 16*(7*a*sin(5*x)
- 7*a*sin(3*x) + a*sin(x))*cos(6*x) - 56*(3*a*sin(4*x) + 2*a*sin(2*x))*cos(5*x) - 24*(7*a*sin(3*x) - a*sin(x))
*cos(4*x) - (a*cos(8*x)^2 + 16*a*cos(6*x)^2 + 36*a*cos(4*x)^2 + 16*a*cos(2*x)^2 + a*sin(8*x)^2 + 16*a*sin(6*x)
^2 + 36*a*sin(4*x)^2 + 48*a*sin(4*x)*sin(2*x) + 16*a*sin(2*x)^2 + 2*(4*a*cos(6*x) + 6*a*cos(4*x) + 4*a*cos(2*x
) + a)*cos(8*x) + 8*(6*a*cos(4*x) + 4*a*cos(2*x) + a)*cos(6*x) + 12*(4*a*cos(2*x) + a)*cos(4*x) + 8*a*cos(2*x)
 + 4*(2*a*sin(6*x) + 3*a*sin(4*x) + 2*a*sin(2*x))*sin(8*x) + 16*(3*a*sin(4*x) + 2*a*sin(2*x))*sin(6*x) + a)*lo
g(cos(x)^2 + sin(x)^2 + 2*sin(x) + 1) + (a*cos(8*x)^2 + 16*a*cos(6*x)^2 + 36*a*cos(4*x)^2 + 16*a*cos(2*x)^2 +
a*sin(8*x)^2 + 16*a*sin(6*x)^2 + 36*a*sin(4*x)^2 + 48*a*sin(4*x)*sin(2*x) + 16*a*sin(2*x)^2 + 2*(4*a*cos(6*x)
+ 6*a*cos(4*x) + 4*a*cos(2*x) + a)*cos(8*x) + 8*(6*a*cos(4*x) + 4*a*cos(2*x) + a)*cos(6*x) + 12*(4*a*cos(2*x)
+ a)*cos(4*x) + 8*a*cos(2*x) + 4*(2*a*sin(6*x) + 3*a*sin(4*x) + 2*a*sin(2*x))*sin(8*x) + 16*(3*a*sin(4*x) + 2*
a*sin(2*x))*sin(6*x) + a)*log(cos(x)^2 + sin(x)^2 - 2*sin(x) + 1) + 4*(a*cos(7*x) - 7*a*cos(5*x) + 7*a*cos(3*x
) - a*cos(x))*sin(8*x) - 4*(4*a*cos(6*x) + 6*a*cos(4*x) + 4*a*cos(2*x) + a)*sin(7*x) - 16*(7*a*cos(5*x) - 7*a*
cos(3*x) + a*cos(x))*sin(6*x) + 28*(6*a*cos(4*x) + 4*a*cos(2*x) + a)*sin(5*x) + 24*(7*a*cos(3*x) - a*cos(x))*s
in(4*x) - 28*(4*a*cos(2*x) + a)*sin(3*x) + 4*a*sin(x))*sqrt(a)/(2*(4*cos(6*x) + 6*cos(4*x) + 4*cos(2*x) + 1)*c
os(8*x) + cos(8*x)^2 + 8*(6*cos(4*x) + 4*cos(2*x) + 1)*cos(6*x) + 16*cos(6*x)^2 + 12*(4*cos(2*x) + 1)*cos(4*x)
 + 36*cos(4*x)^2 + 16*cos(2*x)^2 + 4*(2*sin(6*x) + 3*sin(4*x) + 2*sin(2*x))*sin(8*x) + sin(8*x)^2 + 16*(3*sin(
4*x) + 2*sin(2*x))*sin(6*x) + 16*sin(6*x)^2 + 36*sin(4*x)^2 + 48*sin(4*x)*sin(2*x) + 16*sin(2*x)^2 + 8*cos(2*x
) + 1)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.83 \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\frac {1}{8} \, {\left (\sqrt {a \tan \left (x\right )^{2} + a} {\left (2 \, \tan \left (x\right )^{2} + 1\right )} \tan \left (x\right ) + \sqrt {a} \log \left ({\left | -\sqrt {a} \tan \left (x\right ) + \sqrt {a \tan \left (x\right )^{2} + a} \right |}\right )\right )} a \]

[In]

integrate(tan(x)^2*(a+a*tan(x)^2)^(3/2),x, algorithm="giac")

[Out]

1/8*(sqrt(a*tan(x)^2 + a)*(2*tan(x)^2 + 1)*tan(x) + sqrt(a)*log(abs(-sqrt(a)*tan(x) + sqrt(a*tan(x)^2 + a))))*
a

Mupad [F(-1)]

Timed out. \[ \int \tan ^2(x) \left (a+a \tan ^2(x)\right )^{3/2} \, dx=\int {\mathrm {tan}\left (x\right )}^2\,{\left (a\,{\mathrm {tan}\left (x\right )}^2+a\right )}^{3/2} \,d x \]

[In]

int(tan(x)^2*(a + a*tan(x)^2)^(3/2),x)

[Out]

int(tan(x)^2*(a + a*tan(x)^2)^(3/2), x)